home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / mnilu.lzh / EX_HEAD.LST next >
File List  |  1993-06-11  |  2KB  |  44 lines

  1. '
  2. '  This example file demonstrates -On break cont- ,-On error gosub-
  3. '  and to quit with -System-. It's recommended that you have this file as
  4. '  a header file and have your program at label Continue when you want to
  5. '  compile a  file with Mnilu.
  6. '
  7. '
  8. Let Editor=1                     ! Editor=1    -> ran from the editor
  9. '                                !          change it into Editor=0
  10. '                                !          before you save it to compile
  11. '
  12. If Editor=0
  13.   On Break Cont                  ! Stop the break [Control][Shift][Alternate]
  14. Endif
  15. On Error Gosub Error_here        ! On any error go to the error handler
  16. Goto Continue                    ! Continue with the real program
  17. '
  18. Procedure Error_here             ! The error handling routine (.PRG progs)
  19.   Local Result
  20.   Alert 3,"| Error no "+Str$(Err)+" !|",1,"End",Result
  21.   If Result=1
  22.     @End_prog                    ! It's best to quit after such an error!
  23.   Endif
  24.   Resume Xxxx                    ! Re-continue with the program from label Xxxx
  25. Return                           ! You can also use Resume next to restart
  26. '                                ! at the next instruction
  27. Procedure End_prog
  28.   If Editor=1                    ! If ran from the editor then return to it
  29.     End
  30.   Endif
  31.   System                         ! Terminate the program (to the Desktop)
  32. Return
  33. '
  34. '             Your program:
  35. '
  36. Continue:                        ! Insert you program here ,when you want to
  37. '                                ! quit then call the End_prog procedure!
  38. ' ->
  39. '
  40. '
  41. '
  42. '
  43. @End_prog
  44.